home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / sommap.nnc < prev    next >
Text File  |  1993-08-23  |  2KB  |  76 lines

  1. csv3.8        ! Control Strategy Version 3.8
  2. !************************************************************************
  3. !*                                    *
  4. !*      2D Self-Organizing Map with mapping                *
  5. !*                                    *
  6. !*    Assumes:    Input Layer                    *
  7. !*            2-D Kohonen Layer                *
  8. !*            Optional Hidden layers                *
  9. !*            Output Layer                    *
  10. !*                                    *
  11. !************************************************************************
  12. !
  13. !    *** Recall ***
  14. !
  15. !MASK     label    op-code    operands    comment
  16. L_saR_sa    trace    aux3        !  set trace option to aux3
  17. L_saR_sa    cset    recall,1    !  recall count
  18. !
  19. L___R_sa    lset    in        !  input layer
  20. L___R_sa    io    read        !  get input data
  21. L___R_sa     math    sum|rnoise|tran|output ! result of input layer
  22. L___R_sa    lset    cur,1        !  next layer, 2D Kohonen layer
  23. L___R_sa     math    sum|tran|output|fire !  get min euclid dist
  24. ! Now do hidden and output layers
  25. L___R_sa @rloop    lset    cur,1           !  next layer
  26. L___R_sa    math    sum|fire
  27. L___R_sa    math    rnoise|tran|output|e=0
  28. L___R_sa    lcmp    out        ! at output layer ?
  29. L___R_sa    blt    @rloop        ! loop till at output layer
  30. L___R_sa    io    write        ! write out result
  31. L___R_sa    io    rcltst        ! read in desired
  32. L___R_sa    math    ce=e|e-=w|swap|fire
  33. L___R_sa    brct    @exit        !  skip to end
  34.  
  35. !    *** Learning ***
  36. L_saR___    lset    in        !  start at input layer
  37. L_saR___    io    lrnin        !  get input data
  38. L_saR___     math    sum|lnoise|tran|output  ! result of input layer
  39. L_saR___    lset    cur, 1        !  2D Kohonen layer
  40. L_saR___    math    sum|output|fire    ! sum does Euclidean distance,
  41.                                         ! sum with bias put in tran fld.
  42. L_saR___    math    learn|fire    ! update wts & freq
  43.  
  44. ! Now do hidden and output layers
  45. L_saR___    cset    wrk2,0
  46. L_saR___ @lloop    lset    cur,1
  47. L_saR___    cadd    wrk2,1      !Count number hidden/output layers
  48. L_saR___    math    sum|fire
  49. L_saR___    math    lnoise|tran|output|e=0|fire
  50. L_saR___    lcmp    out
  51. L_saR___    blt    lloop
  52.  
  53. ! Now we are at the output layer.  Read in the desired output and
  54. ! do back-prop learning down to the kohonen layer
  55. L_saR___    io    lrnrslt         ! result of feed-forward
  56. L_saR___    io    lrnout          ! desired output
  57. L_saR___    math    e-=w|e*=ef|fire !calculate error,scale with errfac
  58.  
  59. L_saR___ @bloop    math    ce=e|e*=f'|backp|fire
  60. L_saR___    math    learn|fire      ! delayed learning for recurrence
  61. L_saR___    lset    cur,-1          ! previous layer
  62. L_saR___    csub    wrk2,1          ! Don't go below hidden
  63. L_saR___    ccmp    wrk2,0
  64. L_saR___    bgt    @bloop
  65. !
  66. LisaRisa @exit    trace    0        !  turn off any trace function
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.